package cn.cqie.attendance.teacher.dao;

import cn.cqie.attendance.teacher.pojo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author wqh
 * @date 2021/7/6 12:16
 */
@Mapper
public interface TeacherHomeworkDao {

    /**
     * 查询当前教师发布的所有作业
     */
    List<TeacherHomeworkRes> queryHomeworkInfoByTeacherId(@Param("param") TeacherHomeworkReq param);

    /**
     * 插入一条作业信息
     */
    int insertHomeworkInfo(@Param("param") InsertHomeworkReq param);
    /**
     * 查询当前教师的所有课程
     */
    List<CourseListRes> queryCourseByTeacherId(@Param("teacherId") Integer teacherId);
    /**
     * 查询某一课程下的小组名和小组id
     */
    List<GroupListRes> queryGroupsByCourseId(@Param("courseId") Integer courseId);

    /**
     * 查询某一小组下的学生名字和id
     */
    List<StudentListRes> queryStudentsByGroupId(@Param("array") String[] groupIds);

    /**
     * 分配作业给具体的学生
     */
    int insertHomeworkByStudentId(Map<String,Object> map);

    /**
     * 发布作业附件
     *//*
    int insertHomeworkAttachment(Map<String,Object> map);*/

    /**
     * 删除一条作业记录(publish_homework)
     */
    int deleteHomeworkById(@Param("id") Integer id);

    /**
     * 删除一条作业记录(homework)
     */
    int deleteHomeworkByPublishHomeworkId(@Param("publishHomeworkId")Integer publishHomeworkId);
    /**
     * 根据批复状态查询作业信息
     */
    List<ReplyHomeworkRes> queryHomeworkReplyByStatus(@Param("param")ReplyHomeworkReq param);

    /**
     * 批复作业
     */
    int updateHomeworkById(Map<String,Object> map);
    /**
     * 学生答题内容
     */
    List<HomeworkAnswer> queryHomeworkAnswerById(@Param("homeworkId")Integer homeworkId);
    /**
     * 查看作业任务详情
     */
    List<HomeworkDetail> queryHomeworkDetailById(@Param("id") Integer id);

    /**
     * 查看作业设置详情
     */
    List<TeacherHomeworkSet> queryHomeworkSetById(@Param("homeworkId")Integer homeworkId);
}
